# -*- coding: utf-8 -*-
import threading
import time


class GetDetailHtml(threading.Thread):
    def __init__(self, name):
        super().__init__(name=name)

    def run(self) -> None:
        print("get detail html started")
        time.sleep(2)
        print("get detail html end")


class GetDetailUrl(threading.Thread):
    def __init__(self, name):
        super().__init__(name=name)

    def run(self) -> None:
        print("get detail url started")
        time.sleep(4)
        print("get detail url end")


if __name__ == "__main__":
    get_detail_html = GetDetailHtml("get_detail_html")
    get_detail_url = GetDetailUrl(name="get_detail_url")
    start_time = time.time()
    get_detail_html.start()
    get_detail_url.start()
    get_detail_html.join()
    get_detail_url.join()

    print("\n main thread end time: {}".format(time.time() - start_time))
